{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<!-- 订单搜索 -->
<div class="form-div">
  <form action="javascript:searchOrder()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    申请类型<select  name="type"  id="type">
             <option  value="0">全部</option>
             <option  value="1">退款</option>
             <option  value="2">退货</option>
             <option  value="3">换货</option>
           </select>
      状态类型<select  name="status"  id="status">
              <option  value="0">全部</option>
             <option  value="1">待审核</option>
             <option  value="2">审核通过</option>
             <option  value="3">审核不通过</option>
             <option  value="4">已结束</option>
           </select>
    {$lang.order_sn}<input name="order_sn" type="text" id="order_sn" size="15">
    申请人<input name="user_name" type="text" id="user_name" size="15">
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<!-- 订单列表 -->
<form method="post" action="order.php?act=operate" name="listForm" onsubmit="return check()">
  <div class="list-div" id="listDiv">
{/if}

<table cellpadding="3" cellspacing="1">
  <tr>
    <th>
      <a href="javascript:listTable.sort('return_id', 'DESC'); ">申请编号</a>{$sort_return_id}
    </th>
     <th>申请类型</a></th>
    <th><a href="javascript:listTable.sort('order_sn', 'DESC'); ">{$lang.order_sn}</a>{$sort_order_sn}</th>
    <th>申请人</a></th> 
    <th><a href="javascript:listTable.sort('money_paid', 'DESC'); ">实际付款金额（包含快递金额）</a>{$sort_money_paid}</th>
    <th><a href="javascript:listTable.sort('request_fee', 'DESC'); ">申请金额</a>{$sort_request_fee}</th>
    <th>快递寄回</th>
    
    <th><a href="javascript:listTable.sort('ctime', 'DESC'); ">申请时间</a>{$sort_ctime}</th>
    <th><a href="javascript:listTable.sort('fact_fee', 'DESC'); ">实际退款金额</a>{$sort_request_fee}</th>
    <th>状态</th>
    <th>{$lang.handler}</th>
  <tr>
  {foreach from=$order_return_list item=order_return key=dkey}
  <tr>
    <td valign="top" nowrap="nowrap">{$order_return.return_id}</td>
    <td valign="top" nowrap="center">{$order_return.type_name}</td>
    <td><a href="order.php?act=info&order_id={$order_return.order_id}">{$order_return.order_sn}<br /></a></td>
    <td align="center" valign="top" nowrap="nowrap">{$order_return.user_name}</td>
    <td align="center" valign="top" nowrap="nowrap">{$order_return.money_paid}（{$order_return.shipping_fee}）</td>
    <td align="center" valign="top" nowrap="nowrap">{$order_return.request_fee}</td>
    <td align="center" valign="top" nowrap="nowrap">{$order_return.shipping_name}--{$order_return.invoice_no}</td>
    
    <td align="center" valign="top" nowrap="nowrap">{$order_return.ctime}</td>
    <td align="center" valign="top" nowrap="nowrap">{$order_return.fact_fee}</td>
    <td align="center" valign="top" nowrap="nowrap">{if $order_return.status==1}待审核{elseif $order_return.status==2}审核通过{elseif $order_return.status==3}审核不通过{elseif $order_return.status==4}已结束{else}异常{/if}</td>
    <td align="center"   nowrap="nowrap">
     <a href="order.php?act=order_return_info&return_id={$order_return.return_id}" title="审核"><img src="images/icon_view.gif" border="0" height="16" width="16"></a>
    </a>
    </td>
  </tr>
  {/foreach}
</table>

<!-- 分页 -->
<table id="page-table" cellspacing="0">
  <tr>
    <td align="right" nowrap="true">
    {include file="page.htm"}
    </td>
  </tr>
</table>

{if $full_page}
  </div>
</form>
<script language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}
{literal}

    onload = function()
    {
        // 开始检查订单
        startCheckOrder();
                
        //
        listTable.query = "order_return_query";
    }

    /**
     * 搜索订单
     */
    function searchOrder()
    {
        listTable.filter['order_sn'] = Utils.trim(document.forms['searchForm'].elements['order_sn'].value);
        listTable.filter['user_name'] = Utils.trim(document.forms['searchForm'].elements['user_name'].value);
                listTable.filter['type'] = document.forms['searchForm'].elements['type'].value;
				 listTable.filter['status'] = document.forms['searchForm'].elements['status'].value;
        listTable.filter['page'] = 1;
                listTable.query = "order_return_query";
        listTable.loadList();
    }

    function check()
    {
      var snArray = new Array();
      var eles = document.forms['listForm'].elements;
      for (var i=0; i<eles.length; i++)
      {
        if (eles[i].tagName == 'INPUT' && eles[i].type == 'checkbox' && eles[i].checked && eles[i].value != 'on')
        {
          snArray.push(eles[i].value);
        }
      }
      if (snArray.length == 0)
      {
        return false;
      }
      else
      {
        eles['order_id'].value = snArray.toString();
        return true;
      }
    }
</script>
{/literal}

{include file="pagefooter.htm"}
{/if}